const validator = async (ctx, next) => {
    try {
        ctx.verifyParams({
            goods_name: {type: "string", required: true},
            goods_price: {type: "number", required: true},
            goods_num: {type: "number", required: true},
            goods_img: {type: "string", required: true},
        })
        await next()

    } catch (e) {
       return ctx.app.emit('err',{code:1020,message:"提交错误"},ctx)
    }
}
module.exports = {validator}